<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>文本的操作</title>
</head>
<body>
    <div id="div"></div>
</body>
<script>
    // innerText 添加文本内容，不解析标签
    let div = document.getElementById("div");
    div.innerText = "YYDS";

    // innerHTML 添加文本内容，解析标签
    div.innerHTML = "<b>YYDS</b>"
</script>
</html>